import React,{useState,useEffect} from "react";
import './index.scss';
import LineCharts from './line.js';
import PieCharts from "./pie.js";
import { getBook } from '../../api/book.js'
const Charts = () => {
  const [list,setList] = useState([])
  useEffect(() => {
    const getBooks = async () => {
      const res = await getBook();
      setList(res.data)
    }
    getBooks();
  },[])
  return (
    <div className="charts">
        <LineCharts list={list}/>
        <PieCharts list={list}/>
     </div> 
  )
}
export default Charts